package com.escope.casemanager.dao;

import com.escope.casemanager.model.CaseExample;
import com.escope.casemanager.model.SysUser;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * Administrator
 * 2024/3/15
 */
@Repository
public interface CaseExampleDao extends JpaRepositoryImplementation<CaseExample, Long> {
    CaseExample findByIdAndBdelete(Long id, String bdelete);

    @Query(value = "SELECT * FROM case_example WHERE map_end_time <= :date and status in ('0','1')", nativeQuery = true)
    List<CaseExample> findExpire(Date date);
}
